# -*- coding: utf-8 -*-
from datetime import timedelta
from utils.operators.external_dag_sensor import ExternalDagSensor
from airflow.operators.dummy_operator import DummyOperator

jms_dwd__dwd_yl_oms_oms_waybill_incre_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_yl_oms_oms_waybill_incre_dt',
    external_dag_id='jms_dwd_oms_day',
    external_task_id='jms_dwd__dwd_yl_oms_oms_waybill_incre_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)
jms_dwd__dwd_barscan_centerarrival_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_tab_barscan_centerarrival_dt',
    external_dag_id='jms_dwd_tab_day',
    external_task_id='jms_dwd__dwd_tab_barscan_centerarrival_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)
jms_dwd__dwd_tab_barscan_collect_base_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_tab_barscan_collect_base_dt',
    external_dag_id='jms_dwd_tab_day',
    external_task_id='jms_dwd__dwd_tab_barscan_collect_base_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)
jms_dwd__dwd_tab_barscan_return_msg_base_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_tab_barscan_return_msg_base_dt',
    external_dag_id='jms_dwd_tab_day',
    external_task_id='jms_dwd__dwd_tab_barscan_return_msg_base_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)
jms_dwd__dwd_tab_barscan_deliver_base_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_tab_barscan_deliver_base_dt',
    external_dag_id='jms_dwd_tab_day',
    external_task_id='jms_dwd__dwd_tab_barscan_deliver_base_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_dwd__dwd_tab_barscan_send_base_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_tab_barscan_send_base_dt',
    external_dag_id='jms_dwd_tab_day',
    external_task_id='jms_dwd__dwd_tab_barscan_send_base_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_dwd__dwd_tab_barscan_arrival_base_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_tab_barscan_arrival_base_dt',
    external_dag_id='jms_dwd_tab_day',
    external_task_id='jms_dwd__dwd_tab_barscan_arrival_base_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)
jms_dwd__dwd_yl_oms_interceptorpiece_base = DummyOperator(
    task_id='jms_dwd__dwd_yl_oms_interceptorpiece_base',
    email=['rongguangfan@jtexpress.com','yl_bigdata@yl-scm.com'],
    retries=0,
    # sla=timedelta(hours=2),
)

jms_dwd__dwd_wide_sign_summary_waybill_dt = DummyOperator(
    task_id='jms_dwd__dwd_wide_sign_summary_waybill_dt',
    email=['rongguangfan@jtexpress.com','yl_bigdata@yl-scm.com'],
    retries=0,
    # sla=timedelta(hours=2),
)
jms_dwd__dwd_oms_order_dt = DummyOperator(
    task_id='jms_dwd__dwd_oms_order_dt',
    email=['rongguangfan@jtexpress.com','yl_bigdata@yl-scm.com'],
    retries=0,
    # sla=timedelta(hours=2),
)



jms_dwd__dwd_tab_barscan_bagging_base_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_tab_barscan_bagging_base_dt',
    external_dag_id='jms_dwd_tab_day',
    external_task_id='jms_dwd__dwd_tab_barscan_bagging_base_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)



jms_dwd__dwd_barscan_unloading_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_barscan_unloading_dt',
    external_dag_id='jms_dwd_tab_day',
    external_task_id='jms_dwd__dwd_barscan_unloading_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)


jms_dwd__dwd_barscan_arrival_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_barscan_arrival_dt',
    external_dag_id='jms_dwd_tab_day',
    external_task_id='jms_dwd__dwd_barscan_arrival_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)


jms_dwd__dwd_barscan_deliver_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_barscan_deliver_dt',
    external_dag_id='jms_dwd_tab_day',
    external_task_id='jms_dwd__dwd_barscan_deliver_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)


dwd_second_package_list_base_dt = ExternalDagSensor(
    task_id='dwd_second_package_list_base_dt',
    external_dag_id='jms_dwd_oms_day',
    external_task_id='dwd_second_package_list_base_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_dwd__dwd_wide_customer_detail_incre_dt = ExternalDagSensor(
    task_id='jms_dwd__dwd_wide_customer_detail_incre_dt',
    external_dag_id='jms_core_wide_day',
    external_task_id='jms_dwd__dwd_wide_customer_detail_incre_dt',
    external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)


jms_dwd__dwd_tab_reback_transfer_express_base = DummyOperator(
    task_id='jms_dwd__dwd_tab_reback_transfer_express_base',
    email=['rongguangfan@jtexpress.com','yl_bigdata@yl-scm.com'],
    retries=0,
    # sla=timedelta(hours=2),
)

jms_dwd__dwd_project_work_order_dt = DummyOperator(
    task_id='jms_dwd__dwd_project_work_order_dt',
    email=['rongguangfan@jtexpress.com','yl_bigdata@yl-scm.com'],
    retries=0,
    # sla=timedelta(hours=2),
)

jms_dwd__dwd_barscan_sign_dt = DummyOperator(
    task_id='jms_dwd__dwd_barscan_sign_dt',
    email=['rongguangfan@jtexpress.com','yl_bigdata@yl-scm.com'],
    retries=0,
    # sla=timedelta(hours=2),
)

jms_dwd__dwd_oms_waybill_dt = DummyOperator(
    task_id='jms_dwd__dwd_oms_waybill_dt',
    email=['rongguangfan@jtexpress.com','yl_bigdata@yl-scm.com'],
    retries=0,
    # sla=timedelta(hours=2),
)

# jms_dwd_yl_oms_interceptorpiece_base = ExternalDagSensor(
#     task_id='jms_dwd_yl_oms_interceptorpiece_base',
#     external_dag_id='jms_dwd_oms_day',
#     external_task_id='jms_dwd_yl_oms_interceptorpiece_base',
#     external_execution_date_time='{{ execution_date | cst_ds }} 03:30:00',
#     execution_delta_time_unit='days',
#     execution_delta=0,
#     allowed_states='success',
#     mode='reschedule',
#     timeout=600
# )
#
# jms_dwd_wide_sign_summary_waybill_dt = ExternalDagSensor(
#     task_id='jms_dwd_wide_sign_summary_waybill_dt',
#     external_dag_id='jms_ods_tms_day',
#     external_task_id='jms_dwd_wide_sign_summary_waybill_dt',
#     external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
#     execution_delta_time_unit='days',
#     execution_delta=0,
#     allowed_states='success',
#     mode='reschedule',
#     timeout=600
# )